﻿''' <summary>
''' 空间属性
''' 映射表: space_att
''' </summary>
Public Class SpaceAttMapper
    Private db As IMySqlService = New MySqlServiceImpl

    Public Function [Select]() As DataTable
        Dim sql As String = <sql>
                                select * from space_att where 1 = 1
                            </sql>
        Return db.select(sql)
    End Function

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <param name="id"> 即sid </param>
    ''' <returns> 返回符合 sid 的所有属性值 </returns>
    Public Function [Select_ById](ByVal id As Integer) As DataTable
        Dim sql As String = <sql>
                                select * from space_att where sid = {0}
                            </sql>
        Return db.select(String.Format(sql, id))
    End Function

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <param name="ids"> sid 数组 </param>
    ''' <returns> 返回符合 sid 的所有属性值  </returns>
    Public Function [Select_ByIds](ByRef ids As Integer()) As DataTable
        Dim sql As String = <sql>
                                select * from space_att where sid in ({0})
                            </sql>
        Return db.select(String.Format(sql, String.Join(",", ids)))
    End Function

End Class
